<template>
    <!-- 切换邮箱验证登录 -->
    <el-link type="success" @click="tradeIn()" style="float: right">{{patternString}}</el-link>
</template>

<script>
export default {
    name: 'Floor',
    data(){
        return{
            patternName: true,
            patternEmail: false,
            patternString: '邮箱登录',
        }
    },
    methods:{
        //切换成手模式登录
        tradeIn(){
            if(this.patternName){
                this.patternName=false;
                this.patternEmail=true;
                this.patternString='用户名登录';
            }else{
                this.patternName=true;
                this.patternEmail=false;
                this.patternString='邮箱验证登录';
            }
            //触发对应的自定义事件,传递值
            this.$bus.$emit('user',this.patternName);
            this.$bus.$emit('email',this.patternEmail);
        },
    },


}
</script>

<style>

</style>